<?php
declare(strict_types=1);

namespace App\Common\Modular\System\Traits\Configure\Traits;

use Core\Package\ElementPlus\FormCreate\FormItem;

trait UserForm
{
    public function getUserFormRule($configure): array
    {
        return [
            FormItem::Switchs('open_reg', '注册会员', (string)$configure['open_reg'] ?? '1')->activeText('允许注册')->inactiveText('禁止注册'),
            FormItem::ImageInput('avatar', '默认头像', $configure['avatar'] ?? '')->required('请设置默认头像')
        ];
    }
}